原來 SASS 的「&」表示重複上一個迴圈的 selector,所以如果寫
.btn {
...
.navbar & {
background: lightsteelblue;
}
}
compile 後會變成
.btn {
...
}
.navbar .btn {
background: lightsteelblue;
}
文章內還有相鄰選擇器的例子供大家參考,我也多學到一招了 XDDD
http://blog.teamtreehouse.com/sass-tip-double-ampersand-selector
同時也有10000部Youtube影片,追蹤數超過2,910的網紅コバにゃんチャンネル,也在其Youtube影片中提到,...
「css selector parent」的推薦目錄:
- 關於css selector parent 在 MUKI SPACE INC. Facebook 的精選貼文
- 關於css selector parent 在 コバにゃんチャンネル Youtube 的精選貼文
- 關於css selector parent 在 大象中醫 Youtube 的最佳解答
- 關於css selector parent 在 大象中醫 Youtube 的最佳貼文
- 關於css selector parent 在 The closest thing we have to a CSS parent selector - YouTube 的評價
- 關於css selector parent 在 Get the Parent of an Element - JavaScript Tutorial 的評價
css selector parent 在 コバにゃんチャンネル Youtube 的精選貼文
css selector parent 在 大象中醫 Youtube 的最佳解答
css selector parent 在 大象中醫 Youtube 的最佳貼文
css selector parent 在 Get the Parent of an Element - JavaScript Tutorial 的美食出口停車場
How it works: First, select the element with the CSS selector #main; Then, use the parentNode property to get the parent element of the selected element. ... <看更多>
css selector parent 在 The closest thing we have to a CSS parent selector - YouTube 的美食出口停車場
Sign up for updates and so you don't miss out on the launch! https://cssdemystified.com/ While we don't have parent selectors at the moment, ... ... <看更多>